package com.test2;

import java.lang.reflect.Method;

import org.apache.commons.beanutils.BeanUtils;

import com.test.Person;

public class Test2 {
	public static void main(String[] args)throws Exception {
		Person person=new Person();
		Method method=Person.class.getDeclaredMethod("setName",String.class);
		method.invoke(person, "xgj");
		//BeanUtils.setProperty(person, "name", "xgj");
		System.out.println(person);
	}
}
